package gae.google.tcserver.db;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * The <tt>TeamMember</tt> class defines the database table that
 * holds information about this entity 
 *
 * @author Lars Friberg
 *
 * @date 2011-01-13
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class TeamMember implements Serializable {

	
	/**
	 * Serial version Id
	 */
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	private Key keyId;					// this is the primary key	

	@Persistent
	private String firstName;			// this is the first name
	
	@Persistent
	private String familyName; 			// this is the family name
	
	@Persistent
	private String address; 	 		// this is the address

	@Persistent
	private String zipCode; 	 		// this is the zip code
	
	@Persistent
	private String location;   			// this is the location

	@Persistent
	private String phoneNumber;			// this is the phone number
	
	@Persistent
	private String mailAddress;			// this is the mail address

	@Persistent
	private String role;   	 			// this is the role (team leader, player or parent)
	
	@Persistent
	private String imageName;  	 		// this is the image name

	@Persistent
	private Key teamKeyId;		 		// the team key Id
	
	/**
	 * get key Id
	 * 
	 * @return keyId the key id
	 */
	public Key getKeyId() {
		return keyId;
	}

	/**
	 * get first name
	 * 
	 * @return firstName the first name
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * get family name
	 * 
	 * @return familyName the family name
	 */
	public String getFamilyName() {
		return familyName;
	}

	/**
	 * get address
	 * 
	 * @return address the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * get zip code
	 * 
	 * @return zipCode the zipCode
	 */
	public String getZipCode() {
		return zipCode;
	}
	
	/**
	 * get location
	 * 
	 * @return location the location 
	 */
	public String getLocation() {
		return location;
	}

	/**
	 * get phone number
	 * 
	 * @return phoneNumber the phone number 
	 */
	public String getPhoneNumber() {
		return phoneNumber;
	}

	/**
	 * get mail address
	 * 
	 * @return mailAddress the mail address 
	 */
	public String getMailAddress() {
		return mailAddress;
	}

	/**
	 * get role
	 * 
	 * @return role the role (leader, player, parent) 
	 */
	public String getRole() {
		return role;
	}
	
	/**
	 * get image name
	 * 
	 * @return imageName the image name 
	 */
	public String getImageName() {
		return imageName;
	}

	/**
	 * get team key Id
	 * 
	 * @return teamKeyId the team key Id 
	 */
	public Key getTeamKeyId() {
		return teamKeyId;
	}

	/**
	 * Constructor
	 */
	public TeamMember() {
		super();
	}

	/**
	 * constructor, initiate parameters
	 * 
	 * @param firstName the first name
	 * @param familyName the family name
	 * @param address the address
	 * @param zipCode the zip code
	 * @param location the location
	 * @param phoneNumber the phone number
	 * @param mailAddress the mailAddress
	 * @param role the role
	 * @param imageName the image name
	 * @param teamKeyId the team key Id
	 */
	public TeamMember(String firstName, String familyName, String address,
					  String zipCode, String location, String phoneNumber,
					  String mailAddress, String role, String imageName,
					  Key teamKeyId) {
		super();
		this.firstName = firstName;
		this.familyName = familyName;
		this.address = address;
		this.zipCode = zipCode;
		this.location = location;
		this.phoneNumber = phoneNumber;
		this.mailAddress = mailAddress;
		this.role = role;
		this.imageName = imageName;
		this.teamKeyId = teamKeyId;
	}
}